package com.zbs.framework.swagger.utils;

import lombok.Data;

import java.util.Map;

@Data
public class ResultData {

    private Long total;
    private Integer code;
    private String message;
    private Object data;

    public static ResultData build(){
        return new ResultData();
    }

    public ResultData() {
    }

    public ResultData(Long total, Object data) {
        this.total = total;
        this.data = data;
    }

    public ResultData(Object data) {
        this.data = data;
    }

    public ResultData total(Long total){
        this.setTotal(total);
        return this;
    }

    public ResultData code(Integer code ){
        this.setCode(code);
        return this;
    }

    public ResultData message(String message){
        this.setMessage(message);
        return this;
    }


    public ResultData data(Object value){
        this.data = value;
        return this;
    }

    public ResultData data(Map<String, Object> data){
        this.setData(data);
        return this;
    }
}
